package com.cd.music.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author yxl 余秀良
 * @version 1.0
 * @description: 订单
 * @date 2018年03月01日  下午11:13
 * @address: 四川成都
 */
@Entity
@Table(name = "`Order`")
public class Order {
    /**
     * 数据id
     */
    @Id
    @Column(nullable = false, unique = true, length = 32)
    private String id;
    /**
     * 订单编号
     */
    @Column(nullable = false, unique = true, length = 32)
    private String orderCode;
    /**
     * 订单状态
     * 0未付款,1已付款,2已发货,3已签收
     */
    @Column(length = 1, columnDefinition = "tinyint(1) default 0")
    private int status = 0;
    /**
     * 商品id
     */
    @Column(length = 32, nullable = false)
    private String goodsId;
    /**
     * 购买数量
     */
    private int goodsTotal = 1;
    /**
     * 订单总金额
     */
    @Column(nullable = false, length = 8, columnDefinition = "decimal(6,2) default 399.00")
    private BigDecimal orderAmount;

    /**
     * 收货地址编号
     */
    @Column(nullable = false, length = 32)
    private String deliveryAddressId;

    /**
     * 买家编号
     */
    @Column(nullable = false, length = 32)
    private String userId;
    /**
     * Ｆ码id
     */
    @Column(nullable = false, length = 100)
    private String fCodeId;

    @Column(columnDefinition = "datetime default now()")
    private Date createTime;


    private boolean isDelete;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public String getDeliveryAddressId() {
        return deliveryAddressId;
    }

    public void setDeliveryAddressId(String deliveryAddressId) {
        this.deliveryAddressId = deliveryAddressId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getfCodeId() {
        return fCodeId;
    }

    public void setfCodeId(String fCodeId) {
        this.fCodeId = fCodeId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(boolean delete) {
        isDelete = delete;
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public int getGoodsTotal() {
        return goodsTotal;
    }

    public void setGoodsTotal(int goodsTotal) {
        this.goodsTotal = goodsTotal;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }
}
